package com.lsfb.light.Login.Register;

import android.content.Intent;
import android.view.View;
import android.widget.TextView;

import com.dalimao.corelibrary.VerificationCodeInput;
import com.lsfb.light.R;
import com.lsfb.light.Utils.TitleUtils;
import com.zgscwjm.lsfbbasetemplate.LsfbActivity;
import com.zgscwjm.lsfbbasetemplate.annotation.ContentView;
import com.zgscwjm.lsfbbasetemplate.annotation.OnClick;
import com.zgscwjm.lsfbbasetemplate.annotation.ViewInject;
import com.zgscwjm.lsfbbasetemplate.utils.LsfbLog;

@ContentView(R.layout.aty_register_code)
public class RegisterCodeActivity extends LsfbActivity {

    @ViewInject(R.id.tv_register_code_phone)
    private TextView tv_phone;

    @ViewInject(R.id.vc_register_code)
    private VerificationCodeInput vc_register_code;

    @Override
    public void initView() {
        TitleUtils.setsimpletitlebar(this, "验证码", true);
        String phone = getIntent().getStringExtra("phone");
        tv_phone.setText("+86 "
                + phone.substring(0, 3) + " "
                + phone.substring(3, 7) + " "
                + phone.substring(7, 11));

        //监听验证码输入完成
        vc_register_code.setOnCompleteListener(new VerificationCodeInput.Listener() {
            @Override
            public void onComplete(String content) {
                LsfbLog.e("完成输入：" + content);
            }
        });
    }

    @Override
    public void initEvent() {

    }

    @Override
    public void initData() {

    }

    @OnClick({R.id.btn_register_code_next, R.id.tv_register_getcode})
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_register_code_next:   //下一步
                startActivity(new Intent(this, SettingPwdActivity.class));
                break;
            case R.id.tv_register_getcode:      //重新获取验证码
                break;
        }
    }
}
